<?php
	include_once("inc/conn.php");
	include_once("inc/function.php"); 
	login_check();
	$usersid=$_SESSION['usersid'];
	$sql = "SELECT reward_discount FROM usergroups
 		WHERE (SELECT experience FROM  users WHERE id={$usersid})
		 BETWEEN creditslower AND creditshigher LIMIT 1";
	$result = $db->query($sql);
	$users = $db->fetch_row($result);
	if(empty($users)){
		header("Location: login.php");
		exit();
	}
	
	$sql = "select is_check_mobile,is_check_email from users where id = '{$usersid}' limit 1";
	$result = $db->query($sql);
	$users = $db->fetch_row($result);
	if(empty($users)){
		header("Location: login.php");
		exit();
	}
	/*
	if($users[0]==0 ||$users[1]==0 ){
		echo ChangeEncodeU2G('<script language="javascript">
				alert("为了让体验卡能发到你邮箱，需要先绑定手机和验证邮箱才能兑换!");
				location.href = "/member.php";
			 </script>');
		exit();
	}
	*/
	$reward_discount=$users[0];
 	
	function curPageURL() 
{
  $pageURL = 'http';
 
  if ($_SERVER["HTTPS"] == "on") 
  {
    $pageURL .= "s";
  }
  $pageURL .= "://";
 
  if ($_SERVER["SERVER_PORT"] != "80") 
  {
    $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
  } 
  else
  {
    $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
  }
  return $pageURL;
}

$wangzhi=curPageURL();

$arr=explode("=", $wangzhi);
//获取最后一个/后边的字符
 $last=$arr[count($arr)-1];
 $card_id=$last;
 if ($dengji <=1
) 
{
$vipgroup="0";
}else if ($dengji >=2&&$dengji<=5
) 
{
$vipgroup="1";
}
else if ($dengji == 6
) 
{
$vipgroup="2";
}
else  if($dengji >= 7
) 
{
$vipgroup="3";
}

 
$my_price=	 ($cart_list["cart_".$card_id]["price"][$vipgroup]*$reward_discount);
$vip1=($cart_list["cart_".$card_id]["price"][0]);
$vip2=($cart_list["cart_".$card_id]["price"][1]);
$vip3=($cart_list["cart_".$card_id]["price"][2]);
$vip4=($cart_list["cart_".$card_id]["price"][3]);
	
?>
<?echo $dengji ?>
7650081176500811

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $web_name ;?> - 活动专区</title>
<?php 
    require 'public/title.inc.php';
?>
<link rel="stylesheet" type="text/css" href="style/product.css" />
</head>
<? include_once("top.php");?>

<?php if ($dengji == 0|| $dengji == 1 
) 
{
$vipgroup="1";
}else if ($dengji == 2|| $dengji == 3 || $dengji == 4 || $dengji == 5
) 
{
$vipgroup="2";
}
else if ($dengji == 6
) 
{
$vipgroup="3";
}
else  if($dengji >= 7
) 
{
$vipgroup="4";
}



?>
<div id="product">
	<div class="container">
	    <div class="panel panel-default">
	        <div class="panel-heading">商品详情 | Product details</div>
	        <div class="panel-body">
				<div class="media">
				  <div class="media-left">
				    <a href="javascript:;"><img class="media-object" src="image/100.png" alt="100"></a>
				  </div>
				  <div class="media-body">
				    <h4>体验卡<?php echo $cart_list["cart_".$card_id]["name"];?>元</h4>
                    <table>
     <tbody> <tr><td align="right" height="30px"><a class="lvspan0">&nbsp;</a>-<a class="lvspan1">&nbsp;</a>兑换价格：</td><td><span class="bdspan"><?echo $vip1 ?></span></td><td></td></tr>
                    <tr><td align="right" height="30px"><a class="lvspan2">&nbsp;</a>-<a class="lvspan5">&nbsp;</a>兑换价格：</td><td><span class="bdspan"><?echo $vip2 ?></span></td><td></td></tr>
                    <tr><td align="right" height="30px"><a class="lvspan6">&nbsp;</a>兑换价格：</td><td><span class="bdspan"><?echo $vip3 ?></span></td><td></td></tr>
                    <tr><td align="right" height="30px"><a class="lvspan7">&nbsp;</a>兑换价格：</td><td><span class="bdspan"><?echo $vip4 ?></span></td><td></td></tr>

</tbody></table>
				   
				    <p>我的兑换价格:<span class="f"><?php echo $my_price;?></span>	</p>
				    <p><a href="proexchang.php?id=<?php echo $last ?>" class="btn btn-danger" style="padding:10px 40px;">立即兑换</a></p>
				  </div>
				</div>
 				<p><strong>奖品寄送方式：</strong></p>
				<p>卡密只能给代理回收，不能自行使用，如果发现不能兑换可以联系<a target="_blank" href="http://wpa.qq.com/msgrd?V=3&amp;uin=252503501&amp;Site=宝时捷28客服&amp;Menu=yes" title="点击这里给我发消息"><img src="http://wpa.qq.com/pa?p=2:252503501:41"></a></p>
				<p>奖品兑换流程：</p>
				<p>1. 奖品价格已经包含邮寄费用在内，您无须另行支付。兑奖前请确认您的帐户中有足够数量的金额！</p>
				<p>2. 在您要兑奖的奖品页面点击“立即兑换”按钮，提交您的兑奖申请！</p>
				<p>3. 确认您的奖品邮寄地址、联系电话正确无误后提交兑奖申请 ！</p>
				<p>4. 实物奖品将在您的兑奖确认后的2-5工作日内发出(奖品状态您可通过“账户中心-兑奖记录”查询)！</p>
				<p>5. 兑奖中心所有奖品颜色均为随机发送, 敬请谅解！</p>
				<p>6. 奖品受供货商库存影响，会有缺货情况，如有缺货，客服会取消兑奖，退还金额。</p> 
	        </div>
	    </div>    
	</div>
</div>

<? echo $card_id ?>








<? include_once("footer.php"); ?>
</body>
</html>
